package com.IoLiu;

import java.io.*;

public class CopyJava {
    public static void main(String[] args) throws IOException {
        copyJava();
    }
    public static void copyJava() throws IOException {
        InputStreamReader isr=new InputStreamReader(new
                FileInputStream("D:\\下载\\file\\file1\\copy.java"),"GBK");
        OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream
                ("D:\\下载\\file\\copy.java",true),"GBK");
        char[] ch=new char[1024];
        int len;
        while((len=isr.read(ch))!=-1){
            osw.write(ch,0,len);
        }
        isr.close();
        osw.close();
    }
}
